package com.yiqi.lottery.entity.enums;

/**
 *      LIJUWEN
 * @email yiyayiyayaoljw@gmail.com
 * @date 2017/5/22 11:05
 */
public enum ShowLotteryType {
    /**
     * 类型 双色球(shuangseqiu) 福彩(fucai) 七乐彩(qilecai) 大乐透(daletou) 排列3(pailie3)
     * 排列5(pailie5) 七星彩(qixingcai) 胜负彩(shengfucai) 进球彩(jinqiucai) 半全场(banquanchang)
     */

    大乐透("大乐透", 0),
    胜负彩("胜负彩", 1),
    任选九("任选九", 2),
    进球彩("进球彩", 3),
    半全场("半全场", 4);


    // 成员变量
    private String name;
    private int index;

    // 构造方法
    private ShowLotteryType(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (ShowLotteryType c : ShowLotteryType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}